<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\imp\otd\otdapi\service;

class ContentRelateRequest {
	
	static $_TSPEC;
	public $taskId = null;
	public $contentId = null;
	public $pgyNote = null;
	public $kolName = null;
	public $contentLink = null;
	public $contentPublishTime = null;
	public $platformType = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'taskId'
			),
			2 => array(
			'var' => 'contentId'
			),
			3 => array(
			'var' => 'pgyNote'
			),
			4 => array(
			'var' => 'kolName'
			),
			5 => array(
			'var' => 'contentLink'
			),
			6 => array(
			'var' => 'contentPublishTime'
			),
			7 => array(
			'var' => 'platformType'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['taskId'])){
				
				$this->taskId = $vals['taskId'];
			}
			
			
			if (isset($vals['contentId'])){
				
				$this->contentId = $vals['contentId'];
			}
			
			
			if (isset($vals['pgyNote'])){
				
				$this->pgyNote = $vals['pgyNote'];
			}
			
			
			if (isset($vals['kolName'])){
				
				$this->kolName = $vals['kolName'];
			}
			
			
			if (isset($vals['contentLink'])){
				
				$this->contentLink = $vals['contentLink'];
			}
			
			
			if (isset($vals['contentPublishTime'])){
				
				$this->contentPublishTime = $vals['contentPublishTime'];
			}
			
			
			if (isset($vals['platformType'])){
				
				$this->platformType = $vals['platformType'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'ContentRelateRequest';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("taskId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->taskId);
				
			}
			
			
			
			
			if ("contentId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->contentId);
				
			}
			
			
			
			
			if ("pgyNote" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->pgyNote); 
				
			}
			
			
			
			
			if ("kolName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->kolName);
				
			}
			
			
			
			
			if ("contentLink" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->contentLink);
				
			}
			
			
			
			
			if ("contentPublishTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->contentPublishTime); 
				
			}
			
			
			
			
			if ("platformType" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->platformType);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->taskId !== null) {
			
			$xfer += $output->writeFieldBegin('taskId');
			$xfer += $output->writeString($this->taskId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->contentId !== null) {
			
			$xfer += $output->writeFieldBegin('contentId');
			$xfer += $output->writeString($this->contentId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->pgyNote !== null) {
			
			$xfer += $output->writeFieldBegin('pgyNote');
			$xfer += $output->writeI32($this->pgyNote);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->kolName !== null) {
			
			$xfer += $output->writeFieldBegin('kolName');
			$xfer += $output->writeString($this->kolName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->contentLink !== null) {
			
			$xfer += $output->writeFieldBegin('contentLink');
			$xfer += $output->writeString($this->contentLink);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldBegin('contentPublishTime');
		$xfer += $output->writeI64($this->contentPublishTime);
		
		$xfer += $output->writeFieldEnd();
		
		if($this->platformType !== null) {
			
			$xfer += $output->writeFieldBegin('platformType');
			$xfer += $output->writeString($this->platformType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>